package mutsumimod.cards.copyandstand;

import com.megacrit.cardcrawl.actions.AbstractGameAction;
import com.megacrit.cardcrawl.actions.common.DamageAllEnemiesAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.cards.DamageInfo;
import com.megacrit.cardcrawl.cards.green.GrandFinale;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.actions.TriggerStandAction;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.util.CardStats;

public class AllCant extends BaseCard {
    public static final String ID = makeID(AllCant.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.ATTACK,
            CardRarity.RARE,
            CardTarget.ALL_ENEMY,
            0
    );


    public AllCant() {
        super(ID, info);
        setAttr(50,0,0);
        setAttrUpg(10,0,0);
        isMultiDamage = true;
        originShouldCopyUse = true;
        setShouldCopyUse(true);
        cardsToPreview = new GrandFinale();
        standTag=10;
    }

    @Override
    public void beforeCopy(){
        clearCopyCardsAddSelf();
        addCopyCards(new GrandFinale());
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        this.addToBot(new TriggerStandAction(p, 10,
                new DamageAllEnemiesAction(AbstractDungeon.player, baseDamage, DamageInfo.DamageType.NORMAL,
                        AbstractGameAction.AttackEffect.SLASH_VERTICAL)));
    }

    @Override
    public AbstractCard makeCopy() { //Optional
        return new AllCant();
    }

    @Override
    public void updateDescription() {
        if(getInCopyUse()){
            rawDescription = cardStrings.EXTENDED_DESCRIPTION[0];
        }else{
            rawDescription = cardStrings.DESCRIPTION;
        }
        initializeDescription();
    }

    @Override
    public void upgrade() {
        if(!upgraded){
            super.upgrade();
            cardsToPreview.upgrade();
        }
    }


}